toolbar: Avoid a get_own_allocation call
authorTimm Bäder <mail@baedert.org>
Sat, 7 Apr 2018 07:26:31 +0000 (09:26 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 10 Apr 2018 07:43:47 +0000 (09:43 +0200)
We want the content allocation here since we are allocation child
widgets.

gtk/gtktoolbar.c

index ffded91c29f77951e46f06e6b0c22ced42c0a052..b75a1c9e6ba924a84bd965de826ce27bddddb1bc 100644 (file)
@@ -1005,7 +1005,10 @@ gtk_toolbar_begin_sliding (GtkToolbar *toolbar)
       g_source_set_name_by_id (priv->idle_id, "[gtk+] slide_idle_handler");
     }
 
-  gtk_widget_get_own_allocation (widget, &content_allocation);
+  content_allocation.x = 0;
+  content_allocation.y = 0;
+  content_allocation.width = gtk_widget_get_width (widget);
+  content_allocation.height = gtk_widget_get_height (widget);
 
   rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
   vertical = (priv->orientation == GTK_ORIENTATION_VERTICAL);
@@ -1021,9 +1024,6 @@ gtk_toolbar_begin_sliding (GtkToolbar *toolbar)
       cur_y = 0;
     }
 
-  cur_x += content_allocation.x;
-  cur_y += content_allocation.y;
-
   for (list = priv->content; list != NULL; list = list->next)
     {
       ToolbarContent *content = list->data;